package com.panda.controller.history;

import com.panda.service.HistoryService;
import com.panda.utils.RespondResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.convert.ReadingConverter;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/histories")
public class HistoryController {


    @Autowired
    private HistoryService service;

    @GetMapping
    public RespondResult getAllHistory(Integer pageNum, Integer pageSize) {
        return service.getAllHistory(pageNum, pageSize);
    }

    @PostMapping
    public RespondResult updateHistory(String key, String value) {
        return service.updateHistory(key, value);
    }

    @DeleteMapping
    public RespondResult deleteAllHistory() {
        return service.deleteAllHistory();
    }
//
//    @DeleteMapping
//    public RespondResult deleteHistory(String key) {
//        return service.deleteHistory(key);
//    }

}
